﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Entitys
{
    public abstract class ValidationRule
    {
        public object FallbackValue { get; set; }

        /// <summary>在派生类中重写时，对值执行验证检查。</summary>
        /// <param name="value">要检查的来自绑定目标的值。</param>
        /// <param name="cultureInfo">要在此规则中使用的区域性。</param>
        /// <returns>
        ///   一个 <see cref="T:System.Windows.Controls.ValidationResult" /> 对象。
        /// </returns>
        public abstract ValidationResult Validate(object value, CultureInfo cultureInfo);
    }
}
